package com.wifi.a007;

import android.content.Intent;
import android.hardware.camera2.CameraCaptureSession;
import android.icu.math.MathContext;
import android.icu.text.BreakIterator;
import android.os.DropBoxManager;
import android.os.Message;
import android.service.carrier.CarrierService;
import android.support.v7.widget.RecyclerView;
import android.util.Log;
import android.view.View;
import android.widget.Toast;

import com.wifi.a007.wifiFragment.HtmlMenu;
import com.wifi.a007.wifiFragment.NetScan;
import com.wifi.a007.wifiFragment.WebFragment;
import com.wifi.a007.wifiFragment.wifiNet;

/**
 * Created by Administrator on 2017/7/1.
 */

public class ClickFunction implements View.OnClickListener{

    private  static ClickFunction  clickFunction=null;



    public static ClickFunction initClick(){

        if(clickFunction == null){

            clickFunction=new ClickFunction();
        }

        return clickFunction;


    }

    @Override
    public  void onClick(View v) {
        /*
        int time1 = Integer.valueOf(ViewName.time.getText().toString());
        int count1=Integer.valueOf(ViewName..count.getText().toString());
        String pingType1=ViewName.pingtype.getText().toString();
        final NetScan netScan=new NetScan(hander);
        netScan.setTime(time1);
        netScan.setGetCount(count1);
        netScan.setPingType(pingType1);
        Thread thread =new Thread(new Runnable() {
            @Override
            public void run() {

                Log.i("scan start","start");
                netScan.scan();

            }
        });
        thread.start();*/
        switch (v.getId()){

            case R.id.html_menu:

                Intent intent=new Intent(ViewName.mContext, HtmlMenu.class);

                ViewName.mContext.startActivity(intent);
                break;

            case R.id.back:

                ViewName.webView.goBack();

                break;
            case R.id.screen:
                 //screenChange();
                break;
            case R.id.map:

                break;
            case R.id.autoLogin:
                WebFragment.loginByAuto();
                break;
        }




    }

    private void gatewayButton(){



        String url1="http://"+NetScan.getGetWay(ViewName.mContext);
       // ViewName.webView.loadUrl(url1);




    }

    public static  void reFresh(){

        try{

        Thread.sleep(3000);

       }catch(Exception e){

           e.printStackTrace();
       }
        ViewName.mainHandler.post(new Runnable() {
            @Override
            public void run() {
                wifiNet.addWifi();
                ViewName.adapter.notifyDataSetChanged();
                ViewName.swipRefresh.setRefreshing(false);
            }
        });


    }



}
